﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestExport.aspx.cs" Inherits="HMS.PL.Forms.TestExport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test Export</title>
    <script type="text/javascript" src="../Scripts/jquery-1.6.1.js"></script>
    <script type="text/javascript">
        function exportRpt(type) {

          //debugger;

            $.ajax({
                async: true,
                type: 'GET',
                url: "ReportsCallback.aspx?operation=" + type + "&dimtable_name=M_EMPLOYEES&list_id=3&sidx=employee_id&sord=desc&rows=10&page=1",
                data: "",
                dataType: "json",
                success: function (result) {
                  //debugger;
                    //var colD = result.datarow, colN = result.columns, colM = result.colModelList;
                },
                error: function (x, e) {
                    //debugger;
                    alert(x.readyState + " " + x.status + " " + e.msg);
                }
            });
        }

        $(document).ready(function () {
            $("#btnExportExcel").click(function () {
              //debugger;
                var url = "ReportsCallback.aspx?operation=export_excel&dimtable_name=M_EMPLOYEES&list_id=3&sidx=employee_id&sord=desc&rows=10&page=1";
                window.location = url;
                //exportRpt('export_excel');
            });
            $("#btnExportPDF").click(function () {
              //debugger;
                var url = "ReportsCallback.aspx?operation=export_pdf&dimtable_name=M_EMPLOYEES&list_id=3&sidx=employee_id&sord=desc&rows=10&page=1";
                window.location = url;
                //exportRpt('export_pdf');
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type="button" value="Export Excel" id="btnExportExcel" />
        <input type="button" value="Export PDF" id="btnExportPDF" />
    </div>
    </form>
</body>
</html>
